package main

import "fmt"

func main() {
	sum, i := 0, 0
	for ; i < 10; i++ {
		sum += i
	}
	fmt.Println("sum: ", sum)

	sum, i = 0, 0
	for {
		sum += i
		i++
		if i >= 10 {
			break
		}
	}
	fmt.Println("sum: ", sum)

	a := [...]int{1, 3, 5, 7}
	sum = 0
	for i, v := range a {
		fmt.Printf("a[%d]=%d ", i, v)
		sum += v
	}
	fmt.Println("sum: ", sum)

}
